package com.bwie.config;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.Charset;

@Configuration
public class BloomFilerConfig {
    @Bean
    public BloomFilter<String> bloomFilter(){
        Charset charset = Charset.forName("utf-8");
        BloomFilter bloomFilter = BloomFilter.create(Funnels.stringFunnel(charset), 100000, 0.0001);
        return bloomFilter;
    }
}
